package team.fhhm.bigwebhomeworkservert.repo;

import java.util.List;
import org.springframework.data.repository.CrudRepository;

import team.fhhm.bigwebhomeworkservert.model.Employee;
import team.fhhm.bigwebhomeworkservert.model.Leave;

public interface LeaveRepository extends CrudRepository<Leave, Integer> {
	
	List<Leave> findByEmployeeOrderBySubmitDescStarttimeAscEndtimeAsc(Employee employee);
	
	List<Leave> findByEmployeeAndStateOrderBySubmitDescStarttimeAscEndtimeAsc(Employee employee, int state);

    List<Leave> findAllByOrderBySubmitDescStarttimeAscEndtimeAsc();

    List<Leave> findByStateAndGrade(int state, int grade);
    
    List<Leave> findByState(int state);
}